package com.miya.lib_common.ui_contract;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;

import com.miya.lib_common.ui_contract.contract.BaseContract;
import com.miya.lib_common.ui_contract.contract.XContract;

/**
 * @author robin 2023-06-10 created
 */
public abstract class XActivity<Contract extends BaseContract, VB extends ViewBinding> extends AppCompatActivity implements XContract.BaseView {
    protected Contract presenter;

    protected abstract Contract bindContract();

    protected VB binding;

    protected abstract VB bindViewBinding();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        presenter = bindContract();
        binding = bindViewBinding();
        super.onCreate(savedInstanceState);
        setContentView(binding.getRoot());
        onCreated();
    }

    public abstract void onCreated();


    @Override
    public void start() {

    }
}
